<?php 
// print_r($help);
// print_r($categories);
?>

<ul class="breadcrumb">
  <li><a href="<?php echo $this->webroot;?>">Home</a><span class="divider">/</span></li>
  <li><a href="<?php echo $this->webroot;?>Help/index"><?php echo __("Lista Helper") ?></a><span class="divider">/</span></li>
  <li class="active"><?php echo __("Nuovo Help"); ?></li>
</ul>
<div class="row-fluid">
	<div class="span8 offset2">
			<ul class="nav nav-pills pull-right">
				<?php foreach ($categories as $key => $category) { ?>
			  		<li <?php if($category['Category']['id']==$help['Help']['categories_id']) echo "class='active'"; ?>>
			  			<?php if(empty($category['Help']['id'])) { ?>
				  			<a href="<?php echo $this->webroot . "/Help/add/".$category['Category']['id']."/".$help['Help']['codice']; ?>"><?php echo $category['Category']['name'];?> <i class='icon-plus'></i></a>
			  			<?php } else { ?>
				  			<a href="<?php echo $this->webroot . "/Help/edit/".$category['Help']['id']; ?>"><?php echo $category['Category']['name']; ?></a>
			  			<?php } ?>
			  		</li>
			  	<?php }?>
			</ul>
	</div>
</div>
<div class="row-fluid">
<div class="span8 hero-unit offset2" >
		<form action="<?php echo $this->webroot;?>Help/save" method="post" id="form">
		<input type='hidden' name='Help[id]'  />
		<input type='hidden' name='Help[categories_id]' value='<?php echo $help['Help']['categories_id'];?>' />
			<fieldset>
				<label><?php echo __("Codice")?></label>
				<input type="text" name="Help[codice]" value="<?php echo $help['Help']['codice'];?>"/>
				<ul class="nav nav-tabs" id="myTab">
				  <li class="active"><a href="#it" data-toggle="tab"><?php echo __("Italiano")?></a></li>
				  <li><a href="#en" data-toggle="tab"><?php echo __("Inglese")?></a></li>
				</ul>
				<div class="tab-content">
				  <div class="tab-pane active" id="it">
				  	<input type="hidden" name="ita[HelpLang][id]"  >
					<div class="input-prepend">
					  <span class="add-on"><i class="icon-globe"></i></span>
					  <input id="prependedInput"   name="ita[HelpLang][link]"  type="text" placeholder=<?php echo __("collegamento esterno"); ?>>
					</div>
			        <label><?php echo __("Titolo Italiano")?></label> 
			        <input type="text" name="ita[HelpLang][titolo]" >
					<textarea id="it_textarea" name="ita[HelpLang][testo]" class="textarea" placeholder="<?php echo __('Inserisci il testo'); ?>" style="width: 100%; height: 200px">
					</textarea>
    			  </div>
				  <div class="tab-pane" id="en">
				  	<input type="hidden" name="eng[HelpLang][id]"  >
				  	<div class="input-prepend">
					  <span class="add-on"><i class="icon-globe"></i></span>
					  <input id="prependedInput"   name="eng[HelpLang][link]"  type="text" placeholder=<?php echo __("collegamento esterno"); ?>>
					</div>
			        <label><?php echo __("Titolo Inglese")?></label> 
			        <input type="text" name="eng[HelpLang][titolo]" >
					<textarea  id="en_textarea" name="eng[HelpLang][testo]" class="textarea" placeholder="<?php echo __('Inserisci il testo'); ?>" style="width: 100%; height: 200px">
					</textarea>
				  </div>
				</div><!--fine tab content-->
				<label class="checkbox">
					<input type="checkbox" name="Help[pubblicato]" value="1" checked="checked" />
					<?php echo __("Pubblicato")?> 
				</label>
				
			</fieldset>
			<p class="pull-right">
				<button type="submit" class="btn btn-primary"><i class='icon-ok'></i></button>
			</p>
		</form>


</div>
</div>
<script>
	$('.textarea').wysihtml5();
</script>
